package com.sanyang.lawyer.service.system;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sanyang.lawyer.entity.System_role;
import com.sanyang.lawyer.mapper.system.System_roleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @program: lawyer
 * @description: 角色表事务
 * @author: Mis.Feng
 * @create: 2019-10-11 10:24
 **/

@Service
public class RoleService {
    @Autowired
    private System_roleMapper roleMapper;

    //角色表查询所有
    public List<System_role> selectAll(Map<String,Object> map){
        return roleMapper.selectAll(map);
    }
    //角色下拉框
    public List<System_role> select(){
        return roleMapper.select();
    }
    //角色表根据id查询
    public System_role getById(int roleid){
        return roleMapper.getById(roleid);
    }
    //角色表根据Name查询
    public int getByName(String roleName){
        return roleMapper.getByName(roleName);
    }
    //添加
    public void insert(System_role role){
        roleMapper.insert(role);
    }
    //修改
    public void update(System_role role){
        roleMapper.update(role);
    }
    //删除
    public void delete(int id){
        roleMapper.delete(id);
    }
    //分页总页数
    public Integer selectCount(Map map) {
        return roleMapper.selectCount(map);
    }
    //判断添加角色名称
    public Integer getByroleName(String roleName){return roleMapper.getByroleName(roleName);}

    public List<System_role> selectrole(){
        return roleMapper.selectrole();
    }

}
